#include "BattleState.h"


BattleState::BattleState(IDirect3DDevice9* m_pD3DDevice)
{
	Create(m_pD3DDevice);
}


BattleState::~BattleState(void)
{
	Destroy();
}

void BattleState::Create(IDirect3DDevice9* m_pD3DDevice)
{
	CreateTextures(m_pD3DDevice);
	CreateObjects(m_pD3DDevice);
}

void BattleState::Render()
{
	g_pLuigi->Render();
}

void BattleState::Destroy()
{
	for(UINT i = 0; i < m_pTexture.size(); i++)
		SAFE_RELEASE(m_pTexture.at(i));

	for(UINT i = 0; i < m_Material.size(); i++)
		SAFE_RELEASE(m_Material.at());
}

void BattleState::Update()
{
	g_pLuigi->Update();
}

void BattleState::CreateTextures(IDirect3DDevice9* m_pD3DDevice)
{
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(0));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(1));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(2));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(3));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(4));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(5));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(6));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(7));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(8));
	IDD3DXCreateTextureFromFile(m_pD3DDevice, L"", &m_pTexture.at(9));

	for(UINT i = 0; i < 10; i++)
	{
		m_Material.at(i).Ambient = D3DXCOLOR(0.2f, 0.2f, 0.2f, 1.0f);	
		m_Material.at(i).Diffuse = D3DXCOLOR(1.0f, 0.3f, 0.3f, 1.0f);
		m_Material.at(i).Emissive = D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f);
		m_Material.at(i).Specular = D3DXCOLOR(0.8f, 0.8f, 0.8f, 1.0f);	
		m_Material.at(i).Power = 30.0f;
	}

}
void BattleState::CreateObjects(IDirect3DDevice9* m_pD3DDevice, std::vector)
{

}